$(function(){
    var question1="false";
    var question2="false";
    var question3="false";

    $("input[type=radio]").on("click",function(){
        var $this = $(this);
        //选项内容
        var optionVal = $this.parent().find(" +div p").html();
        //选项所属题目
        var questionName = $this.parent().find(" +div p").attr("name");
        //选项对错
        var isRirghtKey =  $this.parent().find(" +div p").attr("isRightKey");
        if(questionName=="Q1"){
            question1=isRirghtKey;
            //alert(questionName);
            //alert(question1);
        }else if(questionName=="Q2"){
            question2=isRirghtKey;
            //alert(questionName);
            //alert(question2);
        }else if(questionName=="Q3"){
            question3=isRirghtKey;
            //alert(questionName);
            //alert(question3);
        }
    })

    $("#subBtn").on("click",function(){
        var score = 0 ;
        var count=0;
        if(question1=="true"){
            score+=2;
            count+=1;
        }
        if(question2=="true"){
            score+=2;
            count+=1;
        }
        if(question3=="true"){
            score+=2;
            count+=1;
        }
        alert("每题2分，您答对了"+count+"道题，共计获得"+score+"分");
        window.location.href=getHDIP()+"SweepCarnival/index.html?integral="+score+"&projectNum=2&disposable=true";
    })
})
